import ReactDOM from 'react-dom/client'
import App from './App'
import { store, persistor } from './store'
// 导入redux-persist提供PersistGate组件
import { PersistGate } from 'redux-persist/integration/react'
import { Provider } from 'react-redux'
import { ConfigProvider } from 'antd'
import zhCN from 'antd/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <ConfigProvider
        locale={zhCN}
        theme={{
          token: {
            colorPrimary: '#42bac3',
            colorLink: '#42bac3',
          },
          components: {
            Menu: {
              itemBorderRadius: 0,
            },
            Button: {
              borderRadius: 0,
            },
          },
        }}
      >
        <App />
      </ConfigProvider>
    </PersistGate>
  </Provider>,
)
